It can be somewhat daunting
to implement user authentication
and authorization from scratch
in your application. With Cloud Identity
and Access Management, or Cloud IAM for short, an identity platform
authentication, you are now free
from the burden of building such a system. In the module
Handling Authentication and Authorization, you will learn how to create
IAM members, specify what resources
they have access to, and what operations they can
perform on these resources. You will learn how
to use service accounts to allow your application to authenticate
and authorize itself to invoke
Google Cloud APIs. We’ll discuss how you can
use Identity-Aware Proxy to control access
to your application. The Firebase SDK makes it
really easy to implement Federated Identity
Management. You’ll learn how to use
the Firebase SDK to validate a user
against credentials that are stored
in identity platform, Google Cloud’s
enterprise grade identity and access
management platform. Cloud IAM lets you manage
access control by defining who- the members- has what access,
the role for what resource. You can grant
more granular access to Google Cloud resources using the security principle
of least privilege. Only grant access to resources
that are necessary. You can specify who has access
to your resources with IAM members. Members can be
of the following types: Google account,
service account, Google Group, Google workspace domain,
or Cloud Identity Domain. A Google Cloud account
represents a developer, administrator
or a person who interacts
with Google Cloud. An email address
that is associated with a Google account,
such as a gmail.com address can be an identity. A service account
belongs to an application instead of to
an individual and user. A Google Group
is a name collection of Google accounts
and service accounts. Every group has a unique
email address that is associated
with the group. Google Groups
are a convenient way to apply an access policy
to a collection of users. Google groups don’t have
login credentials, so you cannot use them
to establish identity to make a request
to access a resource. A Google workspace domain
represents a virtual group of all the members
in an organization. Google workspace customers
can associate their email accounts
with an internet domain name. When you do this,
each email account takes the form
username@yourdomain.com. You can specify an identity by
using any internet domain name that is associated with
the Google workspace account. Like groups, domains cannot
be used to establish identity, but they enable convenient
permission management. A Cloud identity domain
represents a virtual group of all members
in an organization, but doesn’t provide access
to Google Workspace applications and features. You can grant access to users
for a Google Cloud Resource. Some examples
of resources or projects, Compute Engine instances, and Cloud Storage buckets,
permissions to determine what operations are allowed
on a resource. In the Cloud IAM world,
permissions are represented in the form
of Service Resource verb. For example, Pub Sub
dot subscriptions dot consume. Permissions usually, but not always correspond one
to one with REST methods. That is,
each Google Cloud Service has an associated
set of permissions for each REST method
that it exposes. The caller of that method needs those permissions
to call that method. For example, the caller
of Publisher dot publish needs the Pub Sub dot topics
dot publish permission. A role is a collection
of permissions. You cannot assign a permission
to the user directly. Instead, you grant them a role. When you grant a role
to a user, you grant them
all the permissions that the role contains. With Cloud IAM,
a cloud API method requires the identity
making the API request to have
the appropriate permissions to use the resource. You can grant permissions
by granting roles to a user, a group or a service account. There are three kinds of roles:
basic, predefined, and custom. The basic roles can be applied
at the project level using the Cloud Console,
the API and the G
Cloud command line tool. Note, granting the owner role
at a resource level such as a Pub Sub topic does not grant the owner role
on the parent project. The owner role does not
contain any permission for the organization resource. Granting the owner role
at the organization level does not allow you to update
the organization’s metadata, but it allows you
to modify projects under that organization. Cloud IAM provides predefined
roles that give granular access to specific
Google Cloud resources and prevent unwanted access
to other resources. You can grant multiple roles
to the same user. For example, the same user
can have network admin and log viewer roles
on a project, and also have a publisher role
for a Pub Sub topic within that project. What if you need something
even finer grained? That’s what custom
roles permit. A lot of companies use
a least privileged model in which each person
in your organization has the minimal amount
of privilege needed to do his or her job. So for example,
maybe I want to define an instance operator role
to allow some users to stop and start Compute Engine
virtual machines but not reconfigure them. Custom roles allow me
to do that. A couple of cautions
about custom roles. First, if you decide
to use custom roles, you’ll need to manage the
permissions that make them up. Some companies decide
they’d rather stick with a predefined roles. Second, custom roles
can only be used at the project
or organization levels. They can’t be used
at the folder level. A policy is attached
to a resource and it’s used to enforce
access control whenever that resource
is accessed. A Cloud IAM policy is represented
by the policy object. A policy consists
of a list of bindings. A binding binds
a list of members to a role. The Cloud IAM API
methods available are: set IAM policy, which allows you to set
policies on your resources, get IAM policy, which allows you
to get a policy that was previously set,
and test IAM permissions, which allows you to test
whether the caller has the specific permissions
for a resource. Cloud Platform resources
are organized hierarchically, where the organization node is
the root node in the hierarchy. The projects are the children
of the organization, and the other resources are
the children of the project’s. Each resource has exactly
one parent.